knitr::opts_knit$set(root.dir = '../../')

1 Overall Activation

source('scripts/my_r.R')
library(feather)
## Warning: package 'feather' was built under R version 3.3.2
library(ggplot2)
library(reshape2)
library(bsselectR)
info <- c('Type1', 'newseq.matchgc.Noonan', 'motif_activation')
pos <- load_and_melt('pattern/Type1/newseq.matchgc.Noonan/motif_activation/pattern_positive.feather')
neg <- load_and_melt('pattern/Type1/newseq.matchgc.Noonan/motif_activation/pattern_negative.feather')
ggplot(pos$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Positive)') + labs(x = 'motif', y = 'sequence')

ggplot(neg$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Negative)') + labs(x = 'motif', y = 'sequence')

2 Per Motif Activation

pvalues <- c()
motifs <- c()
for(i in colnames(pos$table)){
    if(i != 'id'){
        poss <- pos$table[[i]]
        negs <- neg$table[[i]]
        pvalues <- c(pvalues, wilcox.test(poss, negs)$p.value)
        motifs <- c(motifs, i)
    }
}
df <- data.frame(motif=motifs, p.value=pvalues)

2.1 Motif activation comparison (positive vs negative)

3 Show top 20 motifs

3.1 1 : Motif.106

1 : Motif.106

1 : Motif.106

3.2 2 : Motif.274

2 : Motif.274

2 : Motif.274

3.3 3 : Motif.309

3 : Motif.309

3 : Motif.309

3.4 4 : Motif.259

4 : Motif.259

4 : Motif.259

3.5 5 : Motif.185

5 : Motif.185

5 : Motif.185

3.6 6 : Motif.165

6 : Motif.165

6 : Motif.165

3.7 7 : Motif.91

7 : Motif.91

7 : Motif.91

3.8 8 : Motif.299

8 : Motif.299

8 : Motif.299

3.9 9 : Motif.73

9 : Motif.73

9 : Motif.73

3.10 10 : Motif.96

10 : Motif.96

10 : Motif.96

3.11 11 : Motif.258

11 : Motif.258

11 : Motif.258

3.12 12 : Motif.24

12 : Motif.24

12 : Motif.24

3.13 13 : Motif.111

13 : Motif.111

13 : Motif.111

3.14 14 : Motif.291

14 : Motif.291

14 : Motif.291

3.15 15 : Motif.280

15 : Motif.280

15 : Motif.280

3.16 16 : Motif.4

16 : Motif.4

16 : Motif.4

3.17 17 : Motif.195

17 : Motif.195

17 : Motif.195

3.18 18 : Motif.203

18 : Motif.203

18 : Motif.203

3.19 19 : Motif.157

19 : Motif.157

19 : Motif.157

3.20 20 : Motif.206

20 : Motif.206

20 : Motif.206